home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fritz: All Fritz
/
All Fritz.zip
/
All Fritz
/
FILES
/
PROGBLER
/
ASMCODE2.LZH
/
CIRCLE_3.ASM
< prev
next >
Wrap
Assembly Source File
|
1983-07-27
|
2KB
|
43 lines
TITLE CALLER - CALLS CIRCLE SUBROUTINE
EXTRN CIRCLE:FAR;external subroutine
STACK SEGMENT PARA STACK 'STACK'
DB 64 DUP('STACK ')
STACK ENDS
CALLER SEGMENT PARA 'CODE'
START PROC FAR
ASSUME CS:CALLER,SS:STACK
X_COORD DW 50 ;INITIAL VALUE X OF CENTER
Y_COORD DW 50 ;INITIAL VALUE Y OF CENTER
PUSH DS ;save ret seg on stack
XOR AX,AX ;zero for ret offset
PUSH AX ;and save on stack
MOV AL,4 ;color/graphics select
INT 10H ;set mode
LOOP_CIR: MOV AX,X_COORD ;X CURRENT COORD
PUSH AX ;save on stack
MOV AX,Y_COORD ;Y CURRENT COORD
PUSH AX ;save on stack
MOV AX,30 ;circle radius
PUSH AX ;save on stack
MOV AX,5 ;aspect numer
PUSH AX ;save on stack
MOV AX,6 ;aspec denom
PUSH AX ;save on stack
MOV AX,1 ;foregrnd color
PUSH AX ;save on stack
CALL CIRCLE ;draw circle
ADC X_COORD,2 ;INCREASE X BY 2
CMP X_COORD,200 ;END VALUE
JA EXIT_POINT ;END OF PROGRAM
CMP X_COORD,120 ;TURNING POINT
JA TURN_POINT
ADC Y_COORD,2 ;INCREASE Y BY 1
JMP LOOP_CIR ;DO ANOTHER CIRCLE
TURN_POINT: ADC Y_COORD,-2 ;DECREASE Y BY 1
JMP LOOP_CIR ;DO ANOTHER CIRCLE
EXIT_POINT: RET ;far ret to DOS
START ENDP
CALLER ENDS
END